import pyautogui
#输入状态： 获得信息 每个状态中


#输出状态： 动作 每个状态下可进行  环绕/接近/不移动
#                            打开前四个高槽/关闭/不打开（巡航导弹）
#                            打开后两个高槽/关闭/不打开（快速重型攻击导弹）
#                            打开中槽3/关闭/不打开（护盾扩展，每个单位周期内消耗电容器获得护盾的加强）
#                            打开中槽5/关闭/不打开（大型护盾维修装置，消耗特定装填物获得一定的护盾值）
#                            打开中槽2/关闭/不打开（后燃器，每个单位周期内消耗一定电容获得加速）
#                            释放无人机/回收无人机/不操作（权重低）

# 重置鼠标位置
def reset_mouse():
    pyautogui.moveTo(960,540,duration=0.8)

# 跃迁
def warp_to():
    pyautogui.keyDown('s')
    pyautogui.click()
    pyautogui.keyUp('s')

# 锁定
def lock_target():
    pyautogui.keyDown('ctrl')
    pyautogui.click()
    pyautogui.keyUp('ctrl')
    # pyautogui.rightClick()
    # pyautogui.moveRel(10,-10,duration=0.8)
    # pyautogui.click()
    # pyautogui.moveRel(-10,10,duration=0.8)

#切换目标
def next_target():
    pyautogui.hotkey('alt', 'right')

def previous_target():
    pyautogui.hotkey('alt', 'left')

# 环绕
def orbit_target():  # orbit the target with hotkeys
    pyautogui.keyDown('w')
    pyautogui.click()
    pyautogui.keyUp('w')

# 接近
def approach_target():
    pyautogui.keyDown('q')
    pyautogui.click()
    pyautogui.keyUp('q')

# 停靠
def dock_ship():
    pyautogui.keyDown('d')
    pyautogui.click()
    pyautogui.keyUp('d')

# 离站
def undock_ship():
    pyautogui.keyDown('u')
    pyautogui.click()
    pyautogui.keyUp('u')

# 高槽全开，集火
def all_high_slots_on():
    pyautogui.press('f1')
    pyautogui.press('f2')
    pyautogui.press('f3')
    pyautogui.press('f4')
    pyautogui.press('f5')
    pyautogui.press('f6')
    # pyautogui.press('f7')
    # pyautogui.press('f8')


# 打开/关闭高槽
def high_slots_1():
    pyautogui.press('f1')

def high_slots_2():
    pyautogui.press('f2')

def high_slots_3():
    pyautogui.press('f3')

def high_slots_4():
    pyautogui.press('f4')

def high_slots_5():
    pyautogui.press('f5')

def high_slots_6():
    pyautogui.press('f6')

'''
def high_slots_7():
    pyautogui.press('f7')

def high_slots_8():
    pyautogui.press('f8')
'''


# 护盾扩展，中槽3
def shield_extender():
    pyautogui.hotkey('alt', 'f3')

# 修盾，中槽5
def shield_booster():
    pyautogui.hotkey('alt', 'f5')

# 后燃，中槽2
def afterburner():
    pyautogui.hotkey('alt', 'f2')

#释放所有无人机
def engage_all_drones():
    pyautogui.press('f')

#召回所有无人机
def return_all_drones():
    pyautogui.hotkey('shift', 'r')


